home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 March / PC Answers CD-ROM 5 (Future Publishing) (March 1995).iso / library / olddiscs / iss12 / experts.exe / GETMON.BAS < prev    next >
Encoding:
BASIC Source File  |  1994-11-04  |  961 b   |  31 lines

  1. DEFINT A-Z
  2. DECLARE FUNCTION GetMonitor% ()
  3.  
  4. PRINT GetMonitor
  5.  
  6. '----------------------------------------------------------------------------
  7. '       Name:           GetMonitor
  8. '       Purpose:        This routine returns the type of monitor
  9. '                       connected to a PC.
  10. '                               0       ----    Not EGA/VGA compatible
  11. '                               1       ----    Color monitor
  12. '                               2       ----    Monochrome monitor
  13. '----------------------------------------------------------------------------
  14. FUNCTION GetMonitor
  15.     DEF SEG = &HC000
  16.     IF (PEEK(0) = &H55) AND (PEEK(1) = &HAA) THEN
  17.         ' Found expansion ROM signature - now test for Color/Mono
  18.  
  19.         DEF SEG = 0
  20.         IF (PEEK(&H489) AND 4) <> 0 THEN
  21.             GetMonitor = 2
  22.         ELSE
  23.             GetMonitor = 1
  24.         END IF
  25.     ELSE
  26.         GetMonitor = 0
  27.     END IF
  28.     DEF SEG
  29. END FUNCTION
  30.  
  31.